{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}\\micro.intra\Projekt\P0624$\P0624_Gem\Kitschelt\submission\figures_main_pol.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}16 Jan 2024, 11:16:32
{txt}
{com}. cd  "\\micro.intra\Projekt\P0624$\P0624_Gem\Kitschelt\submission"
{res}\\micro.intra\Projekt\P0624$\P0624_Gem\Kitschelt\submission
{txt}
{com}. use main_data_pol, clear
{txt}
{com}. *Figure 5
. preserve
{txt}
{com}. drop count
{txt}
{com}. gen count=1
{txt}
{com}. keep if main==1
{txt}(2,286 observations deleted)

{com}. foreach var in x  y {c -(}
{txt}  2{com}.         gen gr_`var'_50=(int(25*                                (`var'+0.0000001))-0.5)/25 if `var'<0
{txt}  3{com}.         replace gr_`var'_50=(int(25*(`var'-0.0000001))+0.5)/25  if `var'>=0
{txt}  4{com}. {c )-}
{txt}(48,068 missing values generated)
(48,068 real changes made)
(56,248 missing values generated)
(56,248 real changes made)

{com}. keep if gr_y_50!=. & gr_x_50!=.
{txt}(0 observations deleted)

{com}. collapse(sum) count, by(gr_y_50 gr_x_50 parti_initial)
{res}{txt}
{com}. fillin gr_y gr_x parti_initial
{txt}
{com}. bysort parti_initial: egen parti_count=sum(count)
{txt}
{com}. gen share= count/parti_count
{txt}(6,726 missing values generated)

{com}. replace share=0 if share==.
{txt}(6,726 real changes made)

{com}. 
. twoway (scatter gr_y gr_x [fweight = share] if parti_initial=="B" & share!=0, mcolor(gold) mfcolor(none) msize(vtiny) msymbol(circle)) ,ylabel(, angle(horizontal))  scheme(s1color) xline(0, lpattern(dash) lcolor(black)) yline(0, lpattern(dash) lcolor(black))  title(Sweden Democrats) ytitle( Authoritarian-Libertarian) xtitle(Left-Right) legend(off) ysize(5) xsize(5.5)
{res}{txt}
{com}. graph save lab_circle_B, replace
{res}{txt}file {bf:lab_circle_B.gph} saved

{com}. 
. twoway (scatter gr_y gr_x [fweight = share] if parti_initial=="G" & share!=0, mcolor(forest_green) mfcolor(none) msize(vtiny) msymbol(circle)) ,ylabel(, angle(horizontal))  scheme(s1color) xline(0, lpattern(dash) lcolor(black)) yline(0, lpattern(dash) lcolor(black))  title(Green Party) ytitle( Authoritarian-Libertarian) xtitle(Left-Right) legend(off) ysize(5) xsize(5.5)
{res}{txt}
{com}. graph save lab_circle_G, replace
{res}{txt}file {bf:lab_circle_G.gph} saved

{com}. 
. twoway (scatter gr_y gr_x [fweight = share] if parti_initial=="M" & share!=0, mcolor(navy) mfcolor(none) msize(vtiny) msymbol(circle)) , ylabel(, angle(horizontal))   scheme(s1color) xline(0, lpattern(dash) lcolor(black)) yline(0, lpattern(dash) lcolor(black))  title(Conservatives) ytitle( Authoritarian-Libertarian) xtitle(Left-Right) legend(off) ysize(5) xsize(5.5)
{res}{txt}
{com}. graph save lab_circle_M, replace
{res}{txt}file {bf:lab_circle_M.gph} saved

{com}. 
. twoway (scatter gr_y gr_x [fweight = share] if parti_initial=="S" & share!=0, mcolor(cranberry) mfcolor(none) msize(vtiny) msymbol(circle)) , ylabel(, angle(horizontal)) scheme(s1color) xline(0, lpattern(dash) lcolor(black)) yline(0, lpattern(dash) lcolor(black))  title(Social Democrats) ytitle( Authoritarian-Libertarian) xtitle(Left-Right) legend(off) ysize(5) xsize(5.5)
{res}{txt}
{com}. graph save lab_circle_S, replace
{res}{txt}file {bf:lab_circle_S.gph} saved

{com}. restore
{txt}
{com}. 
. graph combine  lab_circle_G.gph  lab_circle_B.gph  lab_circle_S.gph  lab_circle_M.gph ///
> , col(2) row(2) scheme(s1mono) ycommon xcommon ///
>  ysize(18) xsize(20) iscale(.7)
{res}{txt}
{com}. graph save Figure_5, replace
{res}{txt}file {bf:Figure_5.gph} saved

{com}.   
. ****Figure 6
. preserve
{txt}
{com}. keep if main==1
{txt}(2,286 observations deleted)

{com}. gen level =1 if nom==1 & vald!=1 
{txt}(29,766 missing values generated)

{com}. replace level =2 if vald==1 
{txt}(29,766 real changes made)

{com}. replace level =3 if  nom_ri==1
{txt}(10,115 real changes made)

{com}. replace level =4 if  vald_ri==1
{txt}(346 real changes made)

{com}. drop if level==2002
{txt}(0 observations deleted)

{com}. keep party_ineng year x y level
{txt}
{com}. collapse  (mean) y x  ,by(party_ineng level)
{res}{txt}
{com}. replace  party_ineng="C" if party_ineng=="Cons"
{txt}(4 real changes made)

{com}. 
. foreach var in y x{c -(}
{txt}  2{com}.         twoway (connected `var' level if party_ineng=="S", sort msize(zero) ///
>  mlabel(party_ineng) mlabsize(medium) mlabcolor(maroon) ///
>  mlabposition(3) lcolor(maroon) lwidth(thin) lpattern(vshortdash)) ///
>  (connected `var' level if party_ineng=="C", sort msize(zero) ///
>  mlabel(party_ineng) mlabsize(medium) mlabcolor(navy) ///
>  mlabposition(3) lcolor(navy) lwidth(thin) lpattern(vshortdash)) ///
>   (connected `var' level if party_ineng=="G" , sort msize(zero) ///
>  mlabel(party_ineng) mlabsize(medium) mlabcolor(forest_green) ///
>  mlabposition(9) lcolor(forest_green) lwidth(thin) lpattern(vshortdash)) ///
>    (connected `var' level if party_ineng=="Sd" , sort msize(zero) ///
>  mlabel(party_ineng) mlabsize(medium) mlabcolor(dkorange) ///
>  mlabposition(9) lcolor(dkorange) lwidth(thin) lpattern(vshortdash)), ///
>  xlabel(1 "Nominated Mun." 2 "Elected Mun." 3 "Nominated Parl" 4"Elected Parl", ) xtitle(Election Year) ytitle(Average Position) ///
> scheme(s1mono)  ylabel(, angle(horizontal) grid)  title (`var')  xscale(range(.8 4.2)) ///
>  legend(order(1 "Social Democrats" 2 "Conservatives" 3 "Green Party" 4 "Sweden Democrats") cols(2))
{txt}  3{com}. graph save   `var'_party_level, replace
{txt}  4{com}. {c )-}
{res}{txt}file {bf:y_party_level.gph} saved
{res}{txt}file {bf:x_party_level.gph} saved

{com}. graph combine  y_party_level.gph x_party_level.gph, scheme(s1mono) col(2) ysize(6) xsize(20) iscale(1.3) 
{res}{txt}
{com}. graph save  Figure_6, replace
{res}{txt}file {bf:Figure_6.gph} saved

{com}. restore
{txt}
{com}. 
. **Figure W6
. foreach samp  in nom_all nom_all_fn06{c -(}
{txt}  2{com}.         preserve
{txt}  3{com}.         keep if `samp'==1
{txt}  4{com}.         keep party_ineng valar x y 
{txt}  5{com}.         collapse  (mean) y x  ,by(party_ineng valar)
{txt}  6{com}.         replace  party_ineng="C" if party_ineng=="Cons"
{txt}  7{com}. 
.         foreach var in y x{c -(}
{txt}  8{com}.                 twoway (connected `var' valar if party_ineng=="S", sort msize(zero) ///
>                         mlabel(party_ineng) mlabsize(medium) mlabcolor(maroon) ///
>                         mlabposition(3) lcolor(maroon) lwidth(thin) lpattern(vshortdash)) ///
>                         (connected `var' valar if party_ineng=="C", sort msize(zero) ///
>                         mlabel(party_ineng) mlabsize(medium) mlabcolor(navy) ///
>                         mlabposition(3) lcolor(navy) lwidth(thin) lpattern(vshortdash)) ///
>                         (connected `var' valar if party_ineng=="G" , sort msize(zero) ///
>                         mlabel(party_ineng) mlabsize(medium) mlabcolor(forest_green) ///
>                         mlabposition(9) lcolor(forest_green) lwidth(thin) lpattern(vshortdash)) ///
>                         (connected `var' valar if party_ineng=="Sd" , sort msize(zero) ///
>                         mlabel(party_ineng) mlabsize(medium) mlabcolor(dkorange) ///
>                         mlabposition(9) lcolor(dkorange) lwidth(thin) lpattern(vshortdash)), ///
>                         xtitle(Election Period) ytitle(Average Position) ///
>                         scheme(s1mono)  ylabel(, angle(horizontal) grid)  title (`var') xlabel(2006(4)2014)  xscale(range(2005 2015)) ///
>                         legend(order(1 "Social Democrats" 2 "Conservatives" 3 "Green Party" 4 "Sweden Democrats") cols(2))
{txt}  9{com}.                         graph save   `var'_party_`samp', replace
{txt} 10{com}.         {c )-}
{txt} 11{com}. restore
{txt} 12{com}. {c )-}
{txt}(68,683 observations deleted)
{res}{txt}(3 real changes made)
{res}{txt}file {bf:y_party_nom_all.gph} saved
{res}{txt}file {bf:x_party_nom_all.gph} saved
(98,431 observations deleted)
{res}{txt}(3 real changes made)
{res}{txt}file {bf:y_party_nom_all_fn06.gph} saved
{res}{txt}file {bf:x_party_nom_all_fn06.gph} saved

{com}. 
. graph combine  y_party_nom_all.gph x_party_nom_all.gph ///
>         y_party_nom_all_fn06.gph x_party_nom_all_fn06.gph ///
>         , scheme(s1mono) col(2) ysize(17) xsize(20) iscale(.7)  
{res}{txt}
{com}. graph save Figure_W6
{res}{txt}file {bf:Figure_W6.gph} saved

{com}. *Create Figure W8
. foreach samp in sm gb  {c -(}
{txt}  2{com}.         foreach var in x y{c -(}
{txt}  3{com}.                 binscatter dum_`samp' `var'    if samp_`samp'==1 , nbins(100)
{txt}  4{com}.                 graph save pred_`samp'_`var', replace
{txt}  5{com}.                 reg dum_`samp' `var'    if samp_`samp'==1, beta
{txt}  6{com}.         {c )-}
{txt}  7{com}. {c )-}
{txt}NOTE: legacy option nbins() has been renamed nquantiles(), and is supported only for backward compatibility.
{res}{txt}warning: nquantiles(100) was specified, but only 99 were generated. see help file under nquantiles() for explanation.
{res}{txt}file {bf:pred_sm_x.gph} saved

      Source {c |}       SS           df       MS      Number of obs   ={res}    50,157
{txt}{hline 13}{c +}{hline 34}   F(1, 50155)     = {res}  2078.90
{txt}       Model {c |} {res}  449.16709         1   449.16709   {txt}Prob > F        ={res}    0.0000
{txt}    Residual {c |} {res} 10836.4798    50,155  .216059811   {txt}R-squared       ={res}    0.0398
{txt}{hline 13}{c +}{hline 34}   Adj R-squared   ={res}    0.0398
{txt}       Total {c |} {res} 11285.6469    50,156  .225010904   {txt}Root MSE        =   {res} .46482

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}      dum_sm{col 14}{c |} Coefficient{col 26}  Std. err.{col 38}      t{col 46}   P>|t|{col 67}        Beta
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 11}x {c |}{col 14}{res}{space 2}-.2000389{col 26}{space 2} .0043873{col 37}{space 1}  -45.59{col 46}{space 3}0.000{col 67}{space 3} -.199499
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .6537001{col 26}{space 2} .0020777{col 37}{space 1}  314.62{col 46}{space 3}0.000{col 67}{space 3}        .
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}NOTE: legacy option nbins() has been renamed nquantiles(), and is supported only for backward compatibility.
{res}{txt}warning: nquantiles(100) was specified, but only 97 were generated. see help file under nquantiles() for explanation.
{res}{txt}file {bf:pred_sm_y.gph} saved

      Source {c |}       SS           df       MS      Number of obs   ={res}    50,157
{txt}{hline 13}{c +}{hline 34}   F(1, 50155)     = {res}   110.66
{txt}       Model {c |} {res} 24.8443844         1  24.8443844   {txt}Prob > F        ={res}    0.0000
{txt}    Residual {c |} {res} 11260.8025    50,155  .224520038   {txt}R-squared       ={res}    0.0022
{txt}{hline 13}{c +}{hline 34}   Adj R-squared   ={res}    0.0022
{txt}       Total {c |} {res} 11285.6469    50,156  .225010904   {txt}Root MSE        =   {res} .47384

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}      dum_sm{col 14}{c |} Coefficient{col 26}  Std. err.{col 38}      t{col 46}   P>|t|{col 67}        Beta
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 11}y {c |}{col 14}{res}{space 2}-.0457201{col 26}{space 2} .0043463{col 37}{space 1}  -10.52{col 46}{space 3}0.000{col 67}{space 3}-.0469192
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .6576428{col 26}{space 2} .0021162{col 37}{space 1}  310.77{col 46}{space 3}0.000{col 67}{space 3}        .
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}NOTE: legacy option nbins() has been renamed nquantiles(), and is supported only for backward compatibility.
{res}{txt}warning: nquantiles(100) was specified, but only 99 were generated. see help file under nquantiles() for explanation.
{res}{txt}file {bf:pred_gb_x.gph} saved

      Source {c |}       SS           df       MS      Number of obs   ={res}    10,631
{txt}{hline 13}{c +}{hline 34}   F(1, 10629)     = {res}   419.15
{txt}       Model {c |} {res}  93.281516         1   93.281516   {txt}Prob > F        ={res}    0.0000
{txt}    Residual {c |} {res} 2365.46837    10,629  .222548534   {txt}R-squared       ={res}    0.0379
{txt}{hline 13}{c +}{hline 34}   Adj R-squared   ={res}    0.0378
{txt}       Total {c |} {res} 2458.74988    10,630  .231302905   {txt}Root MSE        =   {res} .47175

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}      dum_gb{col 14}{c |} Coefficient{col 26}  Std. err.{col 38}      t{col 46}   P>|t|{col 67}        Beta
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 11}x {c |}{col 14}{res}{space 2}-.2036081{col 26}{space 2} .0099451{col 37}{space 1}  -20.47{col 46}{space 3}0.000{col 67}{space 3}-.1947783
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .6238983{col 26}{space 2} .0046187{col 37}{space 1}  135.08{col 46}{space 3}0.000{col 67}{space 3}        .
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}NOTE: legacy option nbins() has been renamed nquantiles(), and is supported only for backward compatibility.
{res}{txt}warning: nquantiles(100) was specified, but only 95 were generated. see help file under nquantiles() for explanation.
{res}{txt}file {bf:pred_gb_y.gph} saved

      Source {c |}       SS           df       MS      Number of obs   ={res}    10,631
{txt}{hline 13}{c +}{hline 34}   F(1, 10629)     = {res}  3404.30
{txt}       Model {c |} {res} 596.461891         1  596.461891   {txt}Prob > F        ={res}    0.0000
{txt}    Residual {c |} {res} 1862.28799    10,629  .175208203   {txt}R-squared       ={res}    0.2426
{txt}{hline 13}{c +}{hline 34}   Adj R-squared   ={res}    0.2425
{txt}       Total {c |} {res} 2458.74988    10,630  .231302905   {txt}Root MSE        =   {res} .41858

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}      dum_gb{col 14}{c |} Coefficient{col 26}  Std. err.{col 38}      t{col 46}   P>|t|{col 67}        Beta
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 11}y {c |}{col 14}{res}{space 2} .4703484{col 26}{space 2} .0080613{col 37}{space 1}   58.35{col 46}{space 3}0.000{col 67}{space 3} .4925317
{txt}{space 7}_cons {c |}{col 14}{res}{space 2}  .629657{col 26}{space 2} .0040615{col 37}{space 1}  155.03{col 46}{space 3}0.000{col 67}{space 3}        .
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. graph combine  pred_gb_y.gph pred_gb_x.gph ///
>   pred_sm_y.gph pred_sm_x.gph ///
> , scheme(s1mono) col(2) ysize(17) xsize(20) iscale(.7)
{res}{txt}
{com}. graph save Figure_W8
{res}{txt}file {bf:Figure_W8.gph} saved

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}\\micro.intra\Projekt\P0624$\P0624_Gem\Kitschelt\submission\figures_main_pol.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}16 Jan 2024, 11:17:21
{txt}{.-}
{smcl}
{txt}{sf}{ul off}